package com.yupi.yupicturebackend.controller;

import com.yupi.yupicturebackend.annotation.AuthCheck;
import com.yupi.yupicturebackend.common.BaseResponse;
import com.yupi.yupicturebackend.common.ResultUtils;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
@Api(tags = "测试接口")
public class MainController {

    //@AuthCheck
    @io.swagger.annotations.ApiOperation(value = "健康检查", notes = "检查服务是否正常运行")
    @GetMapping("/health")
    public BaseResponse<String> health(){
        return ResultUtils.success("okokok");
    }

    @AuthCheck(mustRole = "vip")
    @io.swagger.annotations.ApiOperation(value = "VIP接口", notes = "仅VIP用户可访问的测试接口")
    @GetMapping("/vip")
    public BaseResponse<String> vip(){
        return ResultUtils.success("VIPVIP");
    }
}
